/*
 Copyright (C) 2009 QDSS.org
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.qdss.topisv.api;

import java.io.Serializable;

import org.apache.commons.httpclient.Header;
import org.dom4j.Element;

/**
 * Api调用的返回结果
 * 
 * @author <a href="mailto:zhaofang123@gmail.com">FANGFANG ZHAO</a>
 * @since 0.1.0, Nov 17, 2009
 * @version $Id: Result.java 70 2012-09-08 16:29:34Z zhaofang123 $
 */
public interface Result extends Serializable {
	
	/**
	 * @param headerName
	 * @return
	 */
	Header getHeader(String headerName);
	
	/**
	 * @param header
	 * @return
	 */
	String getHeaderValue(String headerName);
	
	/**
	 * @return
	 */
	Element rootElement();
	
	/**
	 * @param xpath
	 * @return
	 */
	Element getNode(String xpath);
	
	/**
	 * @param xpath
	 * @return
	 */
	boolean hasNode(String xpath);
	
	/**
	 * @param xpath
	 * @return
	 */
	String getStringValue(String xpath);
	
	/**
	 * @param xpath
	 * @return
	 */
	int getIntValue(String xpath);
	
	/**
	 * @param xpath
	 * @return
	 */
	long getLongValue(String xpath);
	
	/**
	 * @param xpath
	 * @return
	 */
	double getDoubleValue(String xpath);
	
	/**
	 * 获取调用时长
	 * 
	 * @return
	 */
	long getInvokedTime();
}
